package com.itheima.health.dao;

import com.github.pagehelper.Page;
import com.itheima.health.pojo.Order;
import com.itheima.health.pojo.OrderDto;
import com.itheima.health.pojo.OrderSetting;
import com.itheima.health.pojo.Setmeal;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @author zhangmeng
 * @description 套餐DAO
 * @date 2019/9/26
 **/
@Mapper
public interface SetMealDao {
    /**
     * 插入
     * @param setmeal
     */
    void insert(Setmeal setmeal);

    /**
     * 插入与检查组关联关系
     * @param setmealId
     * @param checkgroupId
     */
    void insertSetMealAndCheckGroup(@Param("setmealId") Integer setmealId, @Param("checkgroupId") Integer checkgroupId);

    /**
     * 根据条件分页查询
     * @param queryString
     * @return
     */
    Page<Setmeal> selectByCondition(@Param("queryString") String queryString);

    /**
     * 套餐列表展示
     * @return
     */
    List<Setmeal> selectAll();

    /**
     * 基于id查询套餐
     * @param id
     * @return
     */
    Setmeal selectById(Integer id);


    long countByImg(@Param("img") String img);

    /**
     * 套餐预约
     * @param
     */
    void addOrder(OrderDto orderDto, Integer memberID,Date date,String type,String status,Integer setmealid);

    Integer selectMemberByTelphone(long telphone);

    Integer selectOrderSetting(Date orderDate);

    Integer selectReservations(Date orderDate);

    Order selectOrderBy(Integer userID);

    Integer selectOrderIdByUserId(Integer userId);

    Order findById(Integer id);

    void updateUserName(String name);

    String selectMemberNameByTelphone(Long telephone);

    Integer findSetmealId(Integer id);

    String selectSetmealName(Integer setmealId);

    Integer findMemberId(Integer id);

    String findNameByMemberId(Integer memberId);

   OrderSetting findOrderDateByDATE(Date orderDate);
}
